package samsung.sds.systemMonitor.SQLMonitor.service.impl;

import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.stereotype.Service;

import samsung.sds.system.common.baseQuery.AbstractBaseService;
import samsung.sds.system.common.baseQuery.BaseMapper;
import samsung.sds.systemMonitor.SQLMonitor.dao.SQLMonitorMapper;
import samsung.sds.systemMonitor.SQLMonitor.model.SQLMonitorEntity;
import samsung.sds.systemMonitor.SQLMonitor.service.SQLMonitorService;

/**
 * @author wei5.gao
 * @createDate 2016-02-22
 * 
 * SQL监控Service实现类
 */
@Service("sQLMonitorServiceImpl")
public class SQLMonitorServiceImpl extends AbstractBaseService<SQLMonitorEntity> implements SQLMonitorService{

	@Autowired
	private SQLMonitorMapper sQLMonitorMapper;
	@Override
	protected BaseMapper<SQLMonitorEntity> getMapper() {
		return sQLMonitorMapper;
	}
	
	/**
	 * SQL监控数据入库方法
	 * 由于在SQLMonitorFilter中事物嵌套，出现异常，导致监控数据保存也出现回滚；
	 * 此方法为唯一不支持事务方法
	 */    	
    public int sqlMonitorSpecialSave (SQLMonitorEntity sqlMonitorEntity){
		return sQLMonitorMapper.insertEntity(sqlMonitorEntity);
    }
}
